home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 21 / AMIGAplus Sonderheft 21 (1999)(ICP)(DE)[!].iso / Magazin / Future-PD / HTML-Creator / Source / CREATE_HTM's < prev    next >
Text File  |  1999-08-23  |  7KB  |  289 lines

  1. x%=1:y%=x%:lan%=-1:ver$="$VER: Part of HTML-Creator V1.23"
  2. ON ERROR GOTO fehler
  3. OPEN "I",#1," CREATE_HTM's.info"
  4. WHILE NOT EOF(1)
  5. INPUT#1,x$
  6. daus%=INSTR(x%,x$,"(DEUTSCH)")
  7. 20 dein%=INSTR(x%,x$,"DEUTSCH")
  8. IF dein%=daus%+1 THEN x%=daus%+2:GOTO 20
  9. eaus%=INSTR(y%,x$,"(ENGLISH)")
  10. 40 eein%=INSTR(y%,x$,"ENGLISH")
  11. IF eein%=eaus%+1 THEN y%=eaus%+2:GOTO 40
  12. WEND
  13. CLOSE
  14. IF dein%>daus%+1 THEN lan%=0
  15. IF eein%>eaus%+1 OR (dein%=0 AND eein%=0) THEN lan%=1
  16.  
  17. start:
  18. datcount%=0:DIM bilder$(5):filecount2%=0:gesamt%=0:count%=0:filecount3%=0
  19. status2%=0
  20. IF lan%=0 THEN
  21. INPUT"Geben Sie den Pfad ein: ",pfad$
  22. ELSE
  23. INPUT"Please enter the path: ",pfad$
  24. END IF
  25. IF pfad$>"" THEN
  26.  IF RIGHT$(pfad$,1)="/" THEN
  27.  ELSE
  28.   IF RIGHT$(pfad$,1)=":" THEN
  29.   ELSE
  30.   pfad$=pfad$+"/"
  31.   END IF
  32.  END IF
  33. END IF
  34. IF lan%=0 THEN
  35. bildfrage0:
  36. PRINT"Wünschen Sie ein Hintergrundbild? j/n":PRINT"(Hinweis: Das gleiche Bild für alle Seiten)"
  37. ja$="J"
  38. else
  39. PRINT"Do you want a background picture? y/n":PRINT"(notice: The same picture for all pages.)"
  40. ja$="Y"
  41. END IF
  42. bildfrage1:a$=UCASE$(INKEY$):SLEEP
  43. IF a$="" THEN bildfrage1
  44. IF a$=ja$ THEN bildja
  45. IF a$="N" THEN beginhtml
  46. GOTO bildfrage1
  47. bildja:
  48. IF lan%=0 THEN
  49. PRINT"Bitte geben Sie den Bildnamen (im Pfad ";pfad$;") an: ";
  50. ELSE
  51. PRINT "Please enter the picture name (within path ";pfad$;"): ";
  52. END IF
  53. INPUT "",bgbild$
  54. checkpic%=1
  55. OPEN"I",#255,pfad$+bgbild$
  56. INPUT#255,x$
  57. CLOSE #255
  58. beginhtml:
  59. checkpic%=0
  60. OPEN "O",#5,pfad$+"INDEX.HTM"
  61. PRINT#5,"<HTML>"
  62. PRINT#5,"<!-- produced ON Amiga"
  63. PRINT#5,"using the HTML-Creator (c) Martin Henke, 1998 //-->"
  64. PRINT#5,"<HEAD>"
  65. PRINT#5,"<TITLE>"
  66. PRINT#5,"INDEX"
  67. PRINT#5,"</TITLE>
  68. PRINT#5,"</HEAD>"
  69. PRINT#5,"<BODY";
  70. IF bgbild$>"" THEN PRINT#5," BACKGROUND=";CHR$(34);bgbild$;chr$(34);
  71. PRINT#5,">"
  72. PRINT#5,"<TABLE CELLSPACING=4 BORDER=0>"
  73. OPEN "I",#4,"directories.txt"
  74. WHILE NOT EOF(4)
  75. 1 INPUT #4,dir$,dat$,status%
  76.  IF status%<2 AND status2%=1 THEN
  77.  PRINT#5,"</TABLE>"
  78.  PRINT#5,"<BR><BR>"
  79.  PRINT#5,"<A HREF="+CHR$(34)+"INDEX.HTM"+CHR$(34)+">INDEX</A>"
  80.  PRINT#5,"</BODY>"
  81.  PRINT#5,"</HTML>"
  82.  CLOSE #5
  83.  OPEN"A",#5,pfad$+"INDEX.HTM"
  84.  status2%=0
  85.  END IF
  86. 2 IF status%=0 AND status2%=0 THEN
  87.   status2%=1:subind$=dat$
  88.   PRINT#5,"</TR>"
  89.   PRINT#5,"<TD><A HREF="CHR$(34)+dat$+".HTM"+CHR$(34)+">"+dat$+"</A></TD>"
  90.   PRINT#5,"</TR>"
  91.   CLOSE #5
  92.   OPEN"O",#5,pfad$+dat$+".HTM"
  93.   PRINT#5,"<HTML>"
  94.   PRINT#5,"<!-- produced ON the Amiga"
  95.   PRINT#5,"using the HTML-Creator (c) Martin Henke, 1998 //-->"
  96.   PRINT#5,"<HEAD>"
  97.   PRINT#5,"<TITLE>"
  98.   PRINT#5,dat$+"-INDEX"
  99.   PRINT#5,"</TITLE>
  100.   PRINT#5,"</HEAD>"
  101.   PRINT#5,"<BODY";
  102.   IF bgbild$>"" THEN PRINT#5," BACKGROUND=";CHR$(34);bgbild$;chr$(34);
  103.   PRINT#5,">"
  104.   PRINT#5,"<TABLE CELLSPACING=4 BORDER=0>"
  105.   END IF
  106. IF status%=0 THEN 1
  107. IF status%=2 THEN 3
  108. IF count%>0 THEN PRINT#5,"</TR>"
  109. 3 PRINT#5,"<TD>"+dat$+"</TD>"
  110. filecount%=1:filecount2%=0:count%=0
  111. CLOSE 1
  112. OPEN"I",#1,"T:"+dat$+".txt"
  113. OPEN"I",#3,"T:"+dat$+"2.txt"
  114. 4 INPUT#1,x$
  115.  
  116.  WHILE a$<>CHR$(32)
  117.  count%=count%+1
  118.  a$=MID$(x$,count%,1)
  119.  IF a$="" THEN 4
  120.  WEND
  121.  
  122. gesamt%=VAL(LEFT$(x$,count%-1))
  123. CLS:PRINT "Bearbeite Verzeichnis '"+dir$+"' mit"+STR$(gesamt%)+" Dateien.":PRINT
  124. WHILE NOT EOF(1)
  125. newhtm:
  126.  IF datcount%<10 THEN
  127.  datcount$="0"+RIGHT$(STR$(datcount%),1)
  128.  ELSE
  129.  datcount$=RIGHT$(STR$(datcount%),2)
  130.  END IF
  131.  
  132.  IF filecount%=1 AND offen%=0 THEN
  133.  datcount2%=VAL(datcount$)+1
  134.  datcount2$=STR$(datcount2%)
  135.  datcount2$=RIGHT$(datcount2$,LEN(datcount2$)-1)
  136.  IF datcount2%<10 THEN datcount2$="0"+datcount2$
  137.  PRINT#5,"<TD>"+"<A HREF="+CHR$(34)+dat$+datcount$+".HTM"+CHR$(34)+">"+datcount2$+"</A></TD>"
  138.  PRINT "Erzeuge Datei "+pfad$+dat$+datcount$+".HTM"
  139.  OPEN "O",#2,pfad$+dat$+datcount$+".HTM"
  140.  offen%=1
  141.  PRINT#2,"<HTML>"
  142.  PRINT#2,"<!-- produced ON the Amiga"
  143.  PRINT#2,"using the HTML-Creator (c) Martin Henke, 1998 //-->"
  144.  PRINT#2,"<HEAD>"
  145.  PRINT#2,"<TITLE>"
  146.  PRINT#2,dat$
  147.  PRINT#2,"</TITLE>"
  148.  PRINT#2,"</HEAD>"
  149.  PRINT#2,"<BODY";
  150.  IF bgbild$>"" THEN PRINT#2," BACKGROUND=";CHR$(34);bgbild$;chr$(34);
  151.  PRINT#2,">"
  152.  PRINT#2,"<TABLE CELLSPACING=10 BORDER=0>
  153.  END IF
  154.  INPUT#1,x$
  155.   IF MID$(x$,LEN(x$)-2,1)=":" THEN
  156.   a$="":a=1
  157.   WHILE a$<>"."
  158.   a$=MID$(x$,a,1)
  159.   a=a+1
  160.   IF a=12 THEN weiter
  161.   WEND
  162.   GOTO weiter2
  163. weiter:
  164.   a=9
  165. weiter2:
  166.   a=a-1
  167.   datei$=LEFT$(x$,a+3):icon$=LEFT$(x$,a)+"GIF"
  168.   IF filecount2%=0 THEN PRINT#2,"<TR>"
  169.   bilder$(filecount2%)=datei$:filecount2%=filecount2%+1
  170.   filecount3%=filecount3%+1
  171.   PRINT#2,"<TD BGCOLOR=000000>
  172.   INPUT#3,x3$
  173.   x3$=RIGHT$(x3$,5)
  174.   breite$=LEFT$(x3$,2):hoehe$=RIGHT$(x3$,2)
  175.   PRINT#2,"<CENTER> <A HREF="+CHR$(34)+dir$+"/"+datei$+CHR$(34)+"><IMG SRC="+CHR$(34)+"ICONS/"+dir$+"/"+icon$+CHR$(34)+" WIDTH="+breite$+" HEIGHT="+hoehe$+" BORDER=0></A>"
  176.   PRINT#2,"</TD>"
  177.    IF filecount%=5 OR filecount%=10 OR filecount%=15 OR filecount3%=gesamt% THEN
  178.    PRINT datei$
  179.    PRINT#2,"</TR><TR>"
  180.    filecount2%=0
  181.    FOR y%=0 TO 4
  182.     IF bilder$(y%)>"" THEN
  183.     PRINT#2,"<TD> <CENTER>"
  184.     PRINT#2,bilder$(y%):bilder$(y%)=""
  185.     PRINT#2,"</TD>"
  186.     END IF
  187.     NEXT
  188.    IF filecount3%<gesamt% THEN PRINT#2,"</TR>"
  189.    END IF
  190.   filecount%=filecount%+1
  191.  END IF
  192.  
  193.   IF filecount%=16 OR EOF(1) THEN
  194.   filecount%=1
  195.   datcount2%=datcount%-1
  196.   datcount3%=datcount%+1
  197.    IF datcount2%<10 THEN
  198.    datcount2$="0"+RIGHT$(STR$(datcount2%),1)
  199.    ELSE
  200.    datcount2$=RIGHT$(STR$(datcount2%),2)
  201.    END IF
  202.    IF datcount2%>0 THEN
  203.    previous$="<A HREF="+CHR$(34)+dat$+datcount2$+".HTM"
  204.    ELSE
  205.     IF status%=2 THEN
  206.     previous$="<A HREF="+CHR$(34)+subind$+".HTM"
  207.     ELSE
  208.     previous$="<A HREF="+CHR$(34)+"INDEX.HTM"
  209.     END IF
  210.    END IF
  211.   previous$=previous$+CHR$(34)+">PREVIOUS</A>"
  212.    IF datcount3%<10 THEN
  213.    datcount3$="0"+RIGHT$(STR$(datcount3%),1)
  214.    ELSE
  215.    datcount3$=RIGHT$(STR$(datcount3%),2)
  216.    END IF
  217.   IF filecount3%<gesamt% THEN
  218.   nextpage$="<A HREF="+CHR$(34)+dat$+datcount3$+".HTM"+CHR$(34)+">NEXT</A>"
  219.   ELSE
  220.   nextpage$="<A HREF="+CHR$(34)+"INDEX.HTM"+CHR$(34)+">NEXT</A>
  221.   END IF
  222.   datcount%=datcount%+1
  223.   PRINT#2,"</TABLE>"
  224.   PRINT#2,"<BR><BR>"
  225.   PRINT#2,"<A HREF="+CHR$(34)+"INDEX.HTM"+CHR$(34)+">INDEX</A>"
  226.   PRINT#2,"  "
  227.   PRINT#2,previous$
  228.   PRINT#2,"  "
  229.   PRINT#2,nextpage$
  230.   PRINT#2,"</BODY>"
  231.   PRINT#2,"</HTML>
  232.   CLOSE 2:offen%=0
  233.   FOR y%=0 TO 4:bilder$(y%)="":NEXT
  234.    IF EOF(1) THEN
  235.    datcount%=0
  236.    GOTO enddir
  237.    ELSE
  238.    GOTO newhtm
  239.    END IF
  240.   END IF
  241. enddir:
  242. WEND:CLOSE 3:filecount3%=0
  243. PRINT#5,"</TR>"
  244. WEND
  245. enddir2:PRINT#5,"</TABLE>"
  246. PRINT#5,"</BODY>"
  247. PRINT#5,"</HTML>"
  248. CLOSE
  249. IF status%<>1 THEN
  250. OPEN "A",#5,pfad$+"INDEX.HTM"
  251. status%=1:GOTO enddir2
  252. END IF
  253. SYSTEM
  254. fehler:
  255. fehler%=ERR
  256. IF lan%=-1 AND fehler%=53 THEN lan%=1:RESUME start
  257. RESUME fehler2
  258. fehler2:
  259. IF checkpic%=1 THEN
  260. PRINT
  261.  IF lan%=0 THEN
  262.  PRINT "Das Hintergrundbild konnte nicht gefunden werden."
  263.  ELSE
  264.  PRINT "The background picture could not be found."
  265.  END IF
  266. PRINT
  267. checkpic%=0
  268. GOTO bildfrage0
  269. END IF
  270. IF lan%=0 THEN
  271.  IF fehler%<>53 THEN
  272.  PRINT "Es ist ein Fehler Nr. ";fehler%;" aufgetreten. Beende Programm.":PRINT "Bitte drücken Sie eine Taste."
  273.  ELSE
  274.  PRINT "Datei nicht gefunden."
  275.  END IF
  276. ELSE
  277.  IF fehler%<>53 THEN
  278.  PRINT "An error number ";fehler%;" occurred. Aborting.":PRINT "Please press any key."
  279.  ELSE
  280.  PRINT "File not found."
  281.  END IF
  282. END IF
  283. ende:
  284. a$=INKEY$:IF a$="" THEN SLEEP
  285. IF a$>"" THEN SYSTEM
  286. GOTO ende
  287.  
  288.  
  289.